<link rel="stylesheet" href="/paycss" type="text/css"/>
<navbar></navbar>
<div class="main" ng-controller="PayCtrl">     
        <!--商家名-->
        <div class="page-header">
            <h1 style="text-align: center">{{merchant.mname}}</h1>
            <h3 style="text-align: center">店铺地址：{{merchant.addr}}</h3>
            
        </div>


        <!--订单状态，如果是已经支付状态，则显示订单状态-->
        <!--当订单是已支付状态，则显示订单状态模块，否则显示核对订单信息模块 -->

            <div class="jumbotron">
                <div class="container">
                <h3>订单详情</h3>
                <p>请仔细核对订单信息</p>
                </div>
            </div>
            
            <!--订单详情 收货地址相关，如果是已经支付状态，则不显示这一块内容-->


                <!--选择收货地址-->
                <div>
                    <form class="form-inline" style="margin-bottom:30px;">
                        <span>请选择收货地址</span>

                            <!-- 显示收货地址 遍历收货地址 -->
                            <select name="addr" class="form-control"  id="addr-select" ng-change="vm.optionval(vm.addrselected)"
                                    ng-model="vm.addrselected" ng-options="'收件人：'+a.contact+'  联系电话：'+a.tel+'  配送地址：'+a.addr for a in vm.addrlist"></select>

                        <input id="newaddr" type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal" ng-click="vm.openModal()" value="新增收货地址"/>
                    </form>
                </div>
                
                
                
            </div>
        <div class="middiv">
        <!--菜品列表及相关信息，这一块内容可以共用-->
        
            
            <div>
                <ul class="list-group">
                    <!--从scope中取出的infolist-->
                    <li class="list-group-item" ng-repeat="o in infolist">
                        <div class="media">
                            <div class="media-left media-middle">
                            <a href="#">
                                <img width="120px" height="100px"   class="media-object" ng-src="{{o.food.fimg}}">
                            </a>
                            </div>
                            <div class="media-body">
                            <h4 class="media-heading">{{o.food.fname}}
                                <span style="font-size:15px;color:brown;font-weight:lighter" ng-switch="o.food.ftype">
                                    <span ng-switch-when="1">酒水类</span>
                                    <span ng-switch-when="2">主食类</span>
                                    <span ng-switch-when="3">小吃类</span>
                                    <span ng-switch-when="4">套餐类</span>
                                </span>
                            </h4>
                            <p style="font-size:18px;"><span class="price-type">价格</span><span class="detail-price">×{{o.count}}
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    ￥{{o.food.fprice}}</span></p>
                            
                            </div>
                        </div>  
                    </li>
            </ul>
                <p style="text-align: right; font-size: 20px">共付：<span style="color: red;font-size: 30px">￥{{vm.sum}}</span></p>
            </div>
            
        

        <!--这一块内容，如果是订单详情页就不显示，替换为取消订单按钮-->
            <div class="right-btn" style="font-size: 20px">
                <input type="hidden" id="icnum" value="${merchant.icnum }">
                <a type="button" ng-click="vm.cancel()" class="btn btn-info btn-lg">再看看</a>
                <button id="payorder" ng-click="vm.pay()" class="btn btn-success btn-lg">确认支付</button>  
            </div>
        </div>
</div>
        